package com.example.datachange.test;

public class Jvm {

    public static void main(String[] args) {
        int sum = 0;
        int count = 1000000;
        long s = System.currentTimeMillis();
        //warm up
        for (int i = 0; i < count ; i++) {
            sum += fn(i);
        }
        long e = System.currentTimeMillis();
        System.out.println(e - s);
    }

    private static int fn(int age) {
        User user = new User(age);
        return user.getAge();
    }
}

class User {
    private final int age;

    public User(int age) {
        this.age = age;
    }

    public int getAge() {
        return age;
    }
}
